package com.wuzhiming.istudy.service;

import com.wuzhiming.istudy.pojo.Course;
import com.wuzhiming.istudy.pojo.CourseType;

import java.util.List;

/**
 * @ClassName: CourseService
 * @Description: 课程service
 * @Author:zhimingw
 * @Version 1.0
 * @since 2022/3/5 15:40
 */
public interface CourseService {

    /**
    * @Description: 通过课程类别查询该类别下所有课程
    * @Param: [id]
    * @return: java.util.List<com.wuzhiming.istudy.pojo.Course>
    * @Author: zhimingw
    * @Date: 2022/3/5
    */
    List<Course> queryAllByTypeId(Integer courseTypeId);
    
    /**
    * @Description: 通过课程id查询课程详情
    * @Param: [id]
    * @return: com.wuzhiming.istudy.pojo.Course
    * @Author: zhimingw
    * @Date: 2022/3/6
    */
    Course queryById(Integer id);

    /**
     * @Description: 根据条件获取课程数量
     * @Param: [status]
     * @return: java.lang.Integer
     * @Author: zhimingw
     * @Date: 2021/5/30
     */
    Integer totalCount(Integer status);

    /**
     * @Description: 根据状态获取课程
     * @Param: [status]
     * @return: java.util.List<top.zhimingw.pojo.Article>
     * @Author: zhimingw
     * @Date: 2021/7/11
     */
    List<Course> queryByStatus(Integer status);

    /**
     * @Description: 修改数据，哪个属性不为空就修改哪个属性
     * @Param: [course]
     * @return: boolean
     * @Author: zhimingw
     * @Date: 2021/5/30
     */
    boolean update(Integer id,String title,String introduce,String courseUrl,Integer courseSections,String courseTime,Integer courseTypeId,Integer courseStageId,Integer status,Integer sort);

    /**
     * @Description: 修改数据，哪个属性不为空就修改哪个属性
     * @Param: [article]
     * @return: boolean
     * @Author: zhimingw
     * @Date: 2021/5/30
     */
    boolean update(Course course);

    /**
     * @Description: 删除course
     * @Param: [id]
     * @return: boolean
     * @Author: zhimingw
     * @Date: 2021/5/30
     */
    boolean deleteById(Integer id);

    /**
     * @Description: 删除全部回收站课程
     * @Param: []
     * @return: java.lang.Integer
     * @Author: zhimingw
     * @Date: 2021/7/16
     */
    Integer deleteTrash();

    /**
     * @Description:
     * @Param: [title, content, tags, kind, introduce, status]
     * @return: java.lang.Integer
     * @Author: zhimingw
     * @Date: 2021/7/21
     */
    Integer publish(String title,String introduce,String courseUrl,Integer courseSections,String courseTime,Integer courseTypeId,Integer courseStageId,Integer status,Integer sort);

    /**
     * @Description: 获得热度前5课程
     * @Param: []
     * @return: java.util.List<com.wuzhiming.istudy.pojo.Course>
     * @Author: zhimingw
     * @Date: 2022/4/4
     */
    List<Course> getHotCourse();

    /**
     * @Description: 通过课程阶段id查询
     * @Param: [courseStageId]
     * @return: java.util.List<com.wuzhiming.istudy.pojo.Course>
     * @Author: zhimingw
     * @Date: 2022/4/4
     */
    List<Course> getCourseByStageId(Integer courseStageId);

    /**
     * @Description: 获取ES中文档的数量
     * @Param: []
     * @return: long
     * @Author: zhimingw
     * @Date: 2021/6/30
     */
    long getEsDocCount();

    /**
     * @Description: 初始化ES
     * @Param: []
     * @return: void
     * @Author: zhimingw
     * @Date: 2021/7/1
     */
    void initEs();

    /**
     * @Description: 从ES中搜索
     * @Param: [content]
     * @return: java.util.List<top.zhimingw.pojo.Article>
     * @Author: zhimingw
     * @Date: 2021/7/1
     */
    List<Course> searchFromEs(String content);
}
